import axios from 'axios'

const instance = axios.create({
    baseURL: 'http://127.0.0.1:8080',
    headers: {'Content-Type': 'application/json'}, // JWT token
    withCredentials: true
})

instance.interceptors.request.use(
    config => {
        // todo
        return config
    },
    error => {
        // todo
        return Promise.reject(error)
    }
)

instance.interceptors.response.use(
    response => {
        // todo
        return response
    },
    error => {
        // todo
        return Promise.reject(error)
    }
)

export default instance